package org.mv.mm.docs.actions;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.mv.mm.docs.FragmentEditTopComponent;
import org.mv.mm.docs.nodes.FragmentNode;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;

@ActionID(category = "LeafFragment",
id = "org.mv.mm.docs.FragmentDetailAction")
@ActionRegistration(displayName = "#CTL_FragmentDetailAction")
@ActionReferences({
  @ActionReference(path = "Menu/File", position = 1300)
})
@Messages("CTL_FragmentDetailAction=Detail for the fragment")
public final class FragmentDetailAction implements ActionListener {

  private final FragmentNode context;

  public FragmentDetailAction(FragmentNode context) {
    this.context = context;
  }

  @Override
  public void actionPerformed(ActionEvent ev) {
    FragmentEditTopComponent tc = new FragmentEditTopComponent();
    tc.open();
    tc.requestActive();
  }
}
